import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
        appBar: AppBar(title: const Text("你好111"),),
        body: listV()
    ),
  ));
}

class listV extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Center(
      child: Container(
        padding: const EdgeInsets.all(20),
        child: ListView(
          scrollDirection: Axis.horizontal,//设置滚动方向为水平
          children:<Widget> [
            Container(
              width: 180,
              color:Colors.redAccent
            ),
            Container(
                width: 180,
                color:Colors.amber
            ),
            Container(
                width: 180,
                color:Colors.cyan
            ),
            Container(
                width: 180,
                color:Colors.green
            ),
          ],
        ),
      ),
    );
  }

}